<?php

class m130818_063541_create_tbl_users extends CDbMigration
{
	public function up()
	{
        $this->createTable('tbl_users',array(
                                            'id' => 'pk',
                                            'name' => 'varchar(50) NOT NULL',
                                            'login' => 'varchar(50) NOT NULL',
                                            'email'=>'varchar(50) NOT NULL',
                                            'password'=>'char(32) NOT NULL',
                                            'avatar'=>'varchar(50) NOT NULL',
                                            'create_time' => 'datetime NOT NULL',
                                            'update_time'=>'datetime NOT NULL',
                                            'create_user_id' => 'int(11) DEFAULT NULL',
                                            'update_user_id' => 'int(11) DEFAULT NULL',
                                            'role'=>'varchar(20) NOT NULL',
                                            'active'=>'boolean DEFAULT 0',
                                            'login_time'=>'datetime DEFAULT NULL',
                                            'last_login_time'=>'datetime DEFAULT NULL',
                                       ));
	}

	public function down()
	{
		$this->dropTable('tbl_users');
	}

	/*
	// Use safeUp/safeDown to do migration with transaction
	public function safeUp()
	{
	}

	public function safeDown()
	{
	}
	*/
}